﻿<%@ Page Title="" Language="C#" MasterPageFile="~/SiteSauces.Master" AutoEventWireup="true" CodeBehind="FrmCategoria.aspx.cs" Inherits="Sauces.Web.Almacen.FrmCategoria" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contenedor" runat="server">
     <fieldset >
         <legend></legend>

         <asp:FormView ID="fvCategoria" runat="server"
        ItemType="Sauces.Bussinees.Entities.Almacen.Categoria"
        SelectMethod="GetCategoria"
        DefaultMode="Edit"
        UpdateMethod="UpDateCategoria"
        InsertMethod="AddCategoria">

        <EditItemTemplate>
            <table>
                <tr>                    
                    <td><asp:TextBox ID="txtID" Text="<%# BindItem.Id %>" runat="server" Visible="false" /></td>
                </tr>

                <tr>
                    <td> <b>Nombre:</b></td>
                    <td><asp:TextBox ID="txtNombre" Text="<%# BindItem.Nombre %>" runat="server" /></td>
                </tr>

                <tr>
                    <td colspan="2">
                        <asp:Button ID="btnGuardarCategoria" Text="Guardar" CommandName="Update" runat="server" OnClientClick="return confirm('ESTA SEGURO QUE DESEA GUARDAR LOS CAMBIOS?');"  />
                    </td>
                </tr>
            </table>
            <validationsummary runat="server" ShowModelStateErrors="true" ForeColor="Red"/>
           
        </EditItemTemplate>

        <InsertItemTemplate>
             <table>
                <tr>
                    
                    <td><asp:TextBox ID="txtID" Text="<%# BindItem.Id==0 %>" runat="server" Visible="false" /></td>
                </tr>

                <tr>
                    <td> <b>Nombre:</b></td>
                    <td><asp:TextBox ID="txtNombre" Text="<%# BindItem.Nombre %>" runat="server"  /> </td>
                </tr>

                <tr>
                    <td colspan="2">
                        <asp:Button ID="btnGuardarCategoria" Text="Guardar" CommandName="insert" runat="server"  OnClientClick="return confirm('ESTA SEGURO QUE DESEA GUARDAR LA CATEGORIA?');" />
                    
                        
                    </td>
                </tr>
            </table>
            <validationsummary runat="server" ShowModelStateErrors="true" />
            <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowModelStateErrors="true" ForeColor="Red"/>
        </InsertItemTemplate>
    </asp:FormView>
     </fieldset>

</asp:Content>
